#include "expression_type.hpp"

namespace DaseX {
    std::string ExpressionTypesToString(ExpressionTypes type)
    {
        switch (type)
        {
            case ExpressionTypes::OPERATOR_CAST:
                return "CAST";
            case ExpressionTypes::OPERATOR_NOT:
                return "NOT";
            case ExpressionTypes::OPERATOR_IS_NULL:
                return "IS_NULL";
            case ExpressionTypes::OPERATOR_IS_NOT_NULL:
                return "IS_NOT_NULL";
            case ExpressionTypes::COMPARE_EQUAL:
                return "EQUAL";
            case ExpressionTypes::COMPARE_NOTEQUAL:
                return "NOTEQUAL";
            case ExpressionTypes::COMPARE_LESSTHAN:
                return "LESSTHAN";
            case ExpressionTypes::COMPARE_GREATERTHAN:
                return "GREATERTHAN";
            case ExpressionTypes::COMPARE_LESSTHANOREQUALTO:
                return "LESSTHANOREQUALTO";
            case ExpressionTypes::COMPARE_GREATERTHANOREQUALTO:
                return "GREATERTHANOREQUALTO";
            case ExpressionTypes::COMPARE_IN:
                return "IN";
            case ExpressionTypes::COMPARE_DISTINCT_FROM:
                return "DISTINCT_FROM";
            case ExpressionTypes::COMPARE_NOT_DISTINCT_FROM:
                return "NOT_DISTINCT_FROM";
            case ExpressionTypes::CONJUNCTION_AND:
                return "AND";
            case ExpressionTypes::CONJUNCTION_OR:
                return "OR";
            case ExpressionTypes::VALUE_CONSTANT:
                return "CONSTANT";
            case ExpressionTypes::VALUE_PARAMETER:
                return "PARAMETER";
            case ExpressionTypes::VALUE_TUPLE:
                return "TUPLE";
            case ExpressionTypes::VALUE_TUPLE_ADDRESS:
                return "TUPLE_ADDRESS";
            case ExpressionTypes::VALUE_NULL:
                return "NULL";
            case ExpressionTypes::VALUE_VECTOR:
                return "VECTOR";
            case ExpressionTypes::VALUE_SCALAR:
                return "SCALAR";
            case ExpressionTypes::AGGREGATE:
                return "AGGREGATE";
            case ExpressionTypes::WINDOW_AGGREGATE:
                return "WINDOW_AGGREGATE";
            case ExpressionTypes::WINDOW_RANK:
                return "RANK";
            case ExpressionTypes::WINDOW_RANK_DENSE:
                return "RANK_DENSE";
            case ExpressionTypes::WINDOW_PERCENT_RANK:
                return "PERCENT_RANK";
            case ExpressionTypes::WINDOW_ROW_NUMBER:
                return "ROW_NUMBER";
            case ExpressionTypes::WINDOW_FIRST_VALUE:
                return "FIRST_VALUE";
            case ExpressionTypes::WINDOW_LAST_VALUE:
                return "LAST_VALUE";
            case ExpressionTypes::WINDOW_NTH_VALUE:
                return "NTH_VALUE";
            case ExpressionTypes::WINDOW_CUME_DIST:
                return "CUME_DIST";
            case ExpressionTypes::WINDOW_LEAD:
                return "LEAD";
            case ExpressionTypes::WINDOW_LAG:
                return "LAG";
            case ExpressionTypes::WINDOW_NTILE:
                return "NTILE";
            case ExpressionTypes::FUNCTION:
                return "FUNCTION";
            case ExpressionTypes::CASE_EXPR:
                return "CASE";
            case ExpressionTypes::OPERATOR_NULLIF:
                return "NULLIF";
            case ExpressionTypes::OPERATOR_COALESCE:
                return "COALESCE";
            case ExpressionTypes::ARRAY_EXTRACT:
                return "ARRAY_EXTRACT";
            case ExpressionTypes::ARRAY_SLICE:
                return "ARRAY_SLICE";
            case ExpressionTypes::STRUCT_EXTRACT:
                return "STRUCT_EXTRACT";
            case ExpressionTypes::SUBQUERY:
                return "SUBQUERY";
            case ExpressionTypes::STAR:
                return "STAR";
            case ExpressionTypes::PLACEHOLDER:
                return "PLACEHOLDER";
            case ExpressionTypes::COLUMN_REF:
                return "COLUMN_REF";
            case ExpressionTypes::FUNCTION_REF:
                return "FUNCTION_REF";
            case ExpressionTypes::TABLE_REF:
                return "TABLE_REF";
            case ExpressionTypes::CAST:
                return "CAST";
            case ExpressionTypes::COMPARE_NOT_IN:
                return "COMPARE_NOT_IN";
            case ExpressionTypes::COMPARE_BETWEEN:
                return "COMPARE_BETWEEN";
            case ExpressionTypes::COMPARE_NOT_BETWEEN:
                return "COMPARE_NOT_BETWEEN";
            case ExpressionTypes::VALUE_DEFAULT:
                return "VALUE_DEFAULT";
            case ExpressionTypes::BOUND_REF:
                return "BOUND_REF";
            case ExpressionTypes::BOUND_COLUMN_REF:
                return "BOUND_COLUMN_REF";
            case ExpressionTypes::BOUND_FUNCTION:
                return "BOUND_FUNCTION";
            case ExpressionTypes::BOUND_AGGREGATE:
                return "BOUND_AGGREGATE";
            case ExpressionTypes::GROUPING_FUNCTION:
                return "GROUPING";
            case ExpressionTypes::ARRAY_CONSTRUCTOR:
                return "ARRAY_CONSTRUCTOR";
            case ExpressionTypes::TABLE_STAR:
                return "TABLE_STAR";
            case ExpressionTypes::BOUND_UNNEST:
                return "BOUND_UNNEST";
            case ExpressionTypes::COLLATE:
                return "COLLATE";
            case ExpressionTypes::POSITIONAL_REFERENCE:
                return "POSITIONAL_REFERENCE";
            case ExpressionTypes::BOUND_LAMBDA_REF:
                return "BOUND_LAMBDA_REF";
            case ExpressionTypes::LAMBDA:
                return "LAMBDA";
            case ExpressionTypes::ARROW:
                return "ARROW";
            case ExpressionTypes::INVALID:
                break;
        }
        return "INVALID";
    }

    std::string ExpressionClassToString(ExpressionClass type)
    {
        switch (type)
        {
            case ExpressionClass::INVALID:
                return "INVALID";
            case ExpressionClass::AGGREGATE:
                return "AGGREGATE";
            case ExpressionClass::CASE:
                return "CASE";
            case ExpressionClass::CAST:
                return "CAST";
            case ExpressionClass::COLUMN_REF:
                return "COLUMN_REF";
            case ExpressionClass::COMPARISON:
                return "COMPARISON";
            case ExpressionClass::CONJUNCTION:
                return "CONJUNCTION";
            case ExpressionClass::CONSTANT:
                return "CONSTANT";
            case ExpressionClass::DEFAULT:
                return "DEFAULT";
            case ExpressionClass::FUNCTION:
                return "FUNCTION";
            case ExpressionClass::OPERATOR:
                return "OPERATOR";
            case ExpressionClass::STAR:
                return "STAR";
            case ExpressionClass::SUBQUERY:
                return "SUBQUERY";
            case ExpressionClass::WINDOW:
                return "WINDOW";
            case ExpressionClass::PARAMETER:
                return "PARAMETER";
            case ExpressionClass::COLLATE:
                return "COLLATE";
            case ExpressionClass::LAMBDA:
                return "LAMBDA";
            case ExpressionClass::POSITIONAL_REFERENCE:
                return "POSITIONAL_REFERENCE";
            case ExpressionClass::BETWEEN:
                return "BETWEEN";
            case ExpressionClass::BOUND_AGGREGATE:
                return "BOUND_AGGREGATE";
            case ExpressionClass::BOUND_CASE:
                return "BOUND_CASE";
            case ExpressionClass::BOUND_CAST:
                return "BOUND_CAST";
            case ExpressionClass::BOUND_COLUMN_REF:
                return "BOUND_COLUMN_REF";
            case ExpressionClass::BOUND_COMPARISON:
                return "BOUND_COMPARISON";
            case ExpressionClass::BOUND_CONJUNCTION:
                return "BOUND_CONJUNCTION";
            case ExpressionClass::BOUND_CONSTANT:
                return "BOUND_CONSTANT";
            case ExpressionClass::BOUND_DEFAULT:
                return "BOUND_DEFAULT";
            case ExpressionClass::BOUND_FUNCTION:
                return "BOUND_FUNCTION";
            case ExpressionClass::BOUND_OPERATOR:
                return "BOUND_OPERATOR";
            case ExpressionClass::BOUND_PARAMETER:
                return "BOUND_PARAMETER";
            case ExpressionClass::BOUND_REF:
                return "BOUND_REF";
            case ExpressionClass::BOUND_SUBQUERY:
                return "BOUND_SUBQUERY";
            case ExpressionClass::BOUND_WINDOW:
                return "BOUND_WINDOW";
            case ExpressionClass::BOUND_BETWEEN:
                return "BOUND_BETWEEN";
            case ExpressionClass::BOUND_UNNEST:
                return "BOUND_UNNEST";
            case ExpressionClass::BOUND_LAMBDA:
                return "BOUND_LAMBDA";
            case ExpressionClass::BOUND_EXPRESSION:
                return "BOUND_EXPRESSION";
            default:
                return "ExpressionClass::!!UNIMPLEMENTED_CASE!!";
        }
    }
} // DaseX

